package org.enea.xlab.lezione3.crudmanager;

import java.io.Serializable;
import java.util.HashMap;

import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.interceptor.Interceptors;

import org.enea.xlab.lezione3.entity.Supplier;
@Stateless
@Interceptors({Profile.class})
public class CRUDManagerImplSingletonFacade implements CRUDManagerRemote, Serializable{

	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@EJB(mappedName="CRUDManagerSingletonImpl/local")
	private CRUDManagerLocal domain;
	
	
	/**
	 * return null se gia' esiste
	 */
	public Long createSupplier(Supplier supplier) {
		
		return domain.createSupplier(supplier);
	}

	public Supplier readSupplier(Long supplierId) {
		
		return domain.readSupplier(supplierId);
	}

	public Boolean updateSupplier(Supplier supplier) {
		
		return domain.updateSupplier(supplier);
	}

	/**
	 * return false quando non cancella nulla
	 */
	public Boolean deleteSupplier(Long supplierId) {
		
		return domain.deleteSupplier(supplierId);
	}

	public HashMap getRegister() {
		// TODO Auto-generated method stub
		return null;
	}
}
